package com.bawei.base.resource.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bawei.base.resource.mapper.ResourceMapper;
import com.bawei.base.resource.model.ResourceExample;
import com.bawei.base.resource.service.ResourceService;

@Service
public class ResourceServiceImpl implements ResourceService {

	@Resource
	private ResourceMapper resourceMapper;

	public void addResource(com.bawei.base.resource.model.Resource resource) {
		resourceMapper.insert(resource);
	}

	public void updateResource(com.bawei.base.resource.model.Resource resource) {
		resourceMapper.updateByPrimaryKey(resource);
	}

	public void deleteResource(Long id) {
		resourceMapper.deleteByPrimaryKey(id);
	}

	public List<com.bawei.base.resource.model.Resource> getResource() {
		return resourceMapper.selectByExample(new ResourceExample());
	}

	public com.bawei.base.resource.model.Resource getResourceById(Long id) {
		return resourceMapper.selectByPrimaryKey(id);
	}
}
